//package com.example.config;
//
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.ComponentScan;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.bind.annotation.RestController;
//import org.springframework.web.servlet.config.annotation.EnableWebMvc;
//import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
///**
// * Created on by qdl in 2020/12/08
// */
//@Configuration
////@EnableWebMvc
////@ComponentScan(basePackages = "com.example")
//public class WebConfig implements WebMvcConfigurer {
//
////    @Value("${upload.dir}")
////    private String uploadDir;
////
////    @Override
////    public void addResourceHandlers(ResourceHandlerRegistry registry) {
////        if (!registry.hasMappingForPattern("/webjars*//**")) {
////            registry.addResourceHandler("/webjars*//**").addResourceLocations("classpath:/META-INF/resources/webjars/");
////        }
////        if (!registry.hasMappingForPattern("*//**")) {
////            registry.addResourceHandler("*//**").addResourceLocations("classpath:/static");
////        }
////        registry.addResourceHandler("/images/**").addResourceLocations("file:"+uploadDir).setCachePeriod(0);
////    }
//    @Override
//    public void configurePathMatch(PathMatchConfigurer configurer) {
//        // 指定controller统一的接口前缀
//        configurer.addPathPrefix("/api", clazz -> clazz.isAnnotationPresent(RestController.class));
//    }
//}
